package priv.yiyuan.example.design.chain.command02;

/**
 * 支付日志处理器
 * <p>
 * 具体处理者
 *
 * @author YiYuan
 * @data 2025/10/9
 * @apoNote
 */
public class PaymentLoggerHandler extends LoggerHandler {

    public PaymentLoggerHandler(LogCommand logCommand) {
        super(logCommand);
    }

    @Override
    public void log(Context context) {

        if (context instanceof PaymentContext) {
            logCommand.execute(context);
        }
        else if (nextHandler != null) {
            nextHandler.log(context);
        }

    }
}
